// 异步代码使用Promise的方式改进
// 拼成 Hello lagou i like you ？
// 方法1
let f1 = new Promise((resolve, reject) => {
  resolve('Hello')
})
let f2 = new Promise((resolve, reject) => {
  resolve('lagou')
})
let f3 = new Promise((resolve, reject) => {
  resolve('i like you')
})
Promise.all([f1, f2, f3]).then((res) =>{
  console.log(res.join(' '))
})

// 方法2
let t1 = new Promise((resolve, reject) => {
  resolve('Hello')
})
t1.then((res) =>{
  return `${res} lagou`
}).then( value =>{
  console.log( `${value} i like you`)
})